home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_13_11
/
weisfeld
/
defines.h
< prev
next >
Wrap
C/C++ Source or Header
|
1995-09-10
|
1KB
|
40 lines
//**************************************************
// Listing 2
//
// FILE NAME : defines.h
// AUTHOR : Matt Weisfeld
//
// DESCRIPTION : constants for semaphore class
//**************************************************
#ifndef DEFINES_H
#define DEFINES_H
#ifdef UNIX
#define FILENAME "file.txt"
#endif
#ifdef DOS
#define FILENAME "g:\\file.txt"
#endif
const ORIGIN=0; // used for fseek() call
const MAX_NODES=10; // the maximum number of nodes
const FILE_LENGTH=200; // the maximum file name length
enum cs_state { // possible critical section states
IDLE, // process is currently idle
WANT_IN, // process wants to enter critical section
IN_CS // process is currently in critical section
};
enum cs_condition { // return state from critical section
NORMAL, // objective not completed in critical section
STOP // objective completed in critical section
};
enum cs_status { // status flags possible states
CLEAR, // clear the appropriate flag - not ready
READY // mark the flag as ready
};
#endif